/**
 * @Date 2023-02-21 09:42:02
 * @Remark
 */

// lib
// import _ from "lodash";
// config
// script & methods & public
// import logUtils from "utils/logUtils";
// state
// import { dataState } from "state/global";
// http
// import { open, bag, isOkRes } from "public/http/api";
// service
import {
  // simpleBooleanService,
  simpleListService,
  simpleObjectService,
  simplePageService,
  simpleResService,
} from "public/service/simple.service";
// api
import {
  API_QUESTION_CLASS_PAGE,
  ReqQuestionClassPage,
  API_QUESTION_CLASS_ADD,
  ReqQuestionClassAddPage,
  API_QUESTION_CLASS_EDIT,
  API_QUESTION_CLASS_DELETE,
  API_QUESTION_PAGE,
  ReqQuestionPage,
  ReqQuestionAddPage,
  API_QUESTION_ADD,
  API_QUESTION_CLASS_LONG_PAGE,
  API_QUESTION_EDIT,
  API_QUESTION_DELETE,
  ReqContractRulePage,
  API_CONTRACT_RULE_PAGE,
  ReqContractRuleAddPage,
  API_CONTRACT_RULE_ADD,
  API_CONTRACT_RULE_EDIT,
  API_CONTRACT_RULE_DELETE,
  API_FEEDBACK_PAGE,
  ReqFeedbackPage,
  API_FEEDBACK_DELETE,
  ReqFeedbackDel,
  API_FEEDBACK_DETAIL,
} from "./api";
// interface
// 其它

// 常见问题分类--分页查询
export async function getQuestionClassPageService(
  params: ReqQuestionClassPage,
) {
  return simplePageService<ReqQuestionClassPage, QuestionClassDto>(
    API_QUESTION_CLASS_PAGE,
    params,
  );
}

// 常见问题分类--新增
export async function addQuestionClassService(params: ReqQuestionClassAddPage) {
  return simpleResService<ReqQuestionClassAddPage>(
    API_QUESTION_CLASS_ADD,
    params,
  );
}

// 常见问题分类--编辑
export async function editQuestionClassService(
  params: ReqQuestionClassAddPage,
) {
  return simpleResService<ReqQuestionClassAddPage>(
    API_QUESTION_CLASS_EDIT,
    params,
  );
}

// 常见问题分类--删除
export async function deleteQuestionClassService(
  params: ReqQuestionClassAddPage,
) {
  return simpleObjectService<ReqQuestionClassAddPage, any>(
    API_QUESTION_CLASS_DELETE,
    params,
  );
}

// 常见问题--分页查询
export async function getQuestionPageService(params: ReqQuestionPage) {
  return simplePageService<ReqQuestionPage, QuestionDto>(
    API_QUESTION_PAGE,
    params,
  );
}

// 常见问题--新增
export async function addQuestionService(params: ReqQuestionAddPage) {
  return simpleResService<ReqQuestionAddPage>(API_QUESTION_ADD, params);
}

// 常见问题分类--不分页列表
export async function getQuestionLongPageService(params: any) {
  return simpleListService<any, QuestionClassDto>(
    API_QUESTION_CLASS_LONG_PAGE,
    params,
  );
}

// 常见问题--编辑
export async function editQuestionService(params: ReqQuestionAddPage) {
  return simpleResService<ReqQuestionAddPage>(API_QUESTION_EDIT, params);
}

// 常见问题--删除
export async function deleteQuestionService(params: ReqQuestionAddPage) {
  return simpleResService<ReqQuestionAddPage>(API_QUESTION_DELETE, params);
}

// 协议规则--分页查询
export async function getContractRulePageService(params: ReqContractRulePage) {
  return simplePageService<ReqContractRulePage, ContractRuleDto>(
    API_CONTRACT_RULE_PAGE,
    params,
  );
}

// 协议规则--新增
export async function addContractRuleService(params: ReqContractRuleAddPage) {
  return simpleResService<ReqContractRuleAddPage>(
    API_CONTRACT_RULE_ADD,
    params,
  );
}

// 协议规则--编辑
export async function editContractRuleService(params: ReqQuestionClassAddPage) {
  return simpleResService<ReqQuestionClassAddPage>(
    API_CONTRACT_RULE_EDIT,
    params,
  );
}

// 协议规则--删除
export async function deleteContractRuleService(
  params: ReqQuestionClassAddPage,
) {
  return simpleResService<ReqQuestionClassAddPage>(
    API_CONTRACT_RULE_DELETE,
    params,
  );
}

// 意见反馈--分页查询
export async function getFeedbackPageService(params: ReqFeedbackPage) {
  return simplePageService<ReqFeedbackPage, FeedbackDto>(
    API_FEEDBACK_PAGE,
    params,
  );
}

// 意见反馈--删除
export async function deleteFeedbackService(params: ReqFeedbackDel) {
  return simpleResService<ReqFeedbackDel>(API_FEEDBACK_DELETE, params);
}

// 意见反馈--详情
export async function getFeedbackDetailPageService(params: ReqFeedbackDel) {
  return simpleObjectService<ReqFeedbackDel, FeedbackDto>(
    API_FEEDBACK_DETAIL,
    params,
  );
}
